export class Stack{

  constructor() {
      // 用数组来实现 栈
      this.arr = []
  }

  // 添加数据
  in (val) {
      this.arr.push(val)
  }

  // 弹出数据
  out () {
      this.arr.pop()
  }

  peek() {
      return this.arr[this.arr.length - 1]
  }


  empty() {
      return this.arr.length === 0
  }
}